package ryrpc

type TblSmsLog struct {
	ID        string `json:"id"`
	Ty        string `json:"ty"`
	State     string `json:"state"`
	Source    string `json:"source"`
	IP        string `json:"ip"`
	Phone     string `json:"phone"`
	Flags     string `json:"flags"`
	Code      string `json:"code"`
	Ts        int64  `json:"ts"`
	CreateAt  int64  `json:"create_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type TblMessageData struct {
	T int64        `json:"total" cbor:"t"`
	S int          `json:"s" cbor:"s"`
	D []TblMessage `json:"d" cbor:"d"`
}

type TblMessageListParam struct {
	Name string `json:"name"`
	Ty   int    `json:"ty"`
	Read int    `json:"read"`
	Page int    `json:"page"`
	Size int    `json:"size"`
}

type TblMessageBulkParam struct {
	Title    string   `json:"title"`
	Content  string   `json:"content"`
	SendName string   `json:"sendName"`
	IsTop    int      `json:"isTop"`
	IsVip    int      `json:"isVip"`
	Ty       int      `json:"ty"`
	Names    []string `json:"names"`
}

type TblMessage struct {
	Id       string `json:"id" cbor:"id"`               // id
	Username string `json:"username" cbor:"username"`   //会员名
	Title    string `json:"title" cbor:"title"`         //标题
	Content  string `json:"content" cbor:"content"`     //内容
	IsTop    int    `json:"is_top" cbor:"is_top"`       //0不置顶 1置顶
	IsVip    int    `json:"is_vip" cbor:"is_vip"`       //0非vip站内信 1vip站内信
	Ty       int    `json:"ty" cbor:"ty"`               //1站内消息 2活动消息
	IsRead   int    `json:"is_read" cbor:"is_read"`     //是否已读 0未读 1已读
	SendName string `json:"send_name" cbor:"send_name"` //发送人名
	SendAt   int64  `json:"send_at" cbor:"send_at"`     //发送时间
}
type TblMemberBaseTotal struct {
	Uid              string  `json:"uid" db:"uid" cbor:"uid"`
	Pid              string  `json:"pid" db:"pid" cbor:"pid"`
	Username         string  `json:"username" db:"username" cbor:"username"`
	Password         string  `json:"-" db:"password" cbor:"-"`                           //登录密码
	CreatedAt        uint32  `json:"created_at" db:"created_at" cbor:"created_at"`       //注册时间
	CreatedIp        string  `json:"created_ip" db:"created_ip" cbor:"created_ip"`       //注册ip
	Phone            string  `json:"phone" db:"phone" cbor:"phone"`                      //手机
	Email            string  `json:"email" db:"email" cbor:"email"`                      //邮箱
	Tester           int     `json:"tester" db:"tester" cbor:"tester"`                   //1正式2模拟
	Avatar           uint8   `json:"avatar" db:"avatar" cbor:"avatar"`                   //头像id
	InviteCode       string  `json:"invite_code" db:"invite_code" cbor:"invite_code"`    //邀请码
	PayPassword      string  `json:"pay_password" db:"pay_password" cbor:"pay_password"` //支付密码
	State            int     `json:"state" db:"state" cbor:"state"`                      //1正常 2登陆锁定
	Remake           string  `json:"remake" db:"remake" cbor:"remake"`                   //备注
	Prefix           string  `json:"prefix" db:"prefix" cbor:"prefix"`                   //前缀
	RealName         string  `json:"real_name" db:"real_name" cbor:"real_name"`          //真实名称
	Currency         string  `json:"currency" db:"currency" cbor:"currency"`             //货币
	OperatorId       string  `json:"operator_id" db:"operator_id" cbor:"operator_id"`    //渠道id
	BusinessId       string  `json:"business_id" db:"business_id" cbor:"business_id"`    //业务员id
	DepositAmount    float64 `json:"deposit_amount" db:"deposit_amount"`
	LastLoginAt      uint32  `json:"last_login_at" db:"last_login_at" cbor:"last_login_at"` //登陆时间
	LastLoginIp      string  `json:"last_login_ip" db:"last_login_ip" cbor:"last_login_ip"` //登陆ip
	Deposit          float64 `json:"deposit" db:"deposit"`
	DepositTimes     int32   `json:"deposit_times" db:"deposit_times"` // 充值人数
	Withdraw         float64 `json:"withdraw" db:"withdraw"`
	WithdrawTimes    int32   `json:"withdraw_times" db:"withdraw_times"` // 提现人数
	Running          float64 `json:"running" db:"running"`
	GameRound        int32   `json:"game_round" db:"game_round"`
	GameWinlost      float64 `json:"game_winlost" db:"game_winlost"`
	GameTax          float64 `json:"game_tax" db:"game_tax"` // 游戏税收
	TurntableBonus   float64 `json:"turntable_bonus" db:"turntable_bonus"`
	ProxyInviteBonus float64 `json:"proxy_invite_bonus" db:"proxy_invite_bonus"` //历史佣金
	Brl              float64 `json:"brl" db:"brl"`                               // 余额
	EnableWithdraw   float64 `json:"enable_withdraw" db:"enable_withdraw"`       // 可提余额
	UpScore          float64 `json:"up_score" db:"up_score"`                     // 后台上分
	IsBloger         int32   `json:"is_bloger" db:"is_bloger"`                   // 是否博主
	ParentId         string  `json:"parent_id" db:"parent_id" cbor:"parent_id"`
	PswErrCnt        string  `json:"PswErrCnt" db:"PswErrCnt" cbor:"PswErrCnt"`
	BlockTime        string  `json:"BlockTime" db:"BlockTime" cbor:"BlockTime"`
	OperatorName     string  `json:"operator_name" db:"operator_name"` // 渠道账号
	BusinessName     string  `json:"business_name" db:"business_name"` // 业务员账号
	ParentName       string  `json:"parent_name" db:"parent_name"`     // 上级账号
	TotalWaged       string  `json:"totalWaged" db:"totalWaged"`       // 总打码

	ColorMoneyFirstCharge float64 `json:"color_money_first_charge" db:"color_money_first_charge"` // 系统赠送彩金金额
	ColorMoneyHand        float64 `json:"color_money_hand" db:"color_money_hand"`                 // 手动赠送彩金金额
	ColorMoneyFreeze      float64 `json:"color_money_freeze" db:"color_money_freeze"`             // 锁定彩金金额

	OtherDeposit string `json:"other_deposit" db:"other_deposit"` // 复充
	FirstDeposit string `json:"first_deposit" db:"first_deposit"` // 首充

	FhideAmount string `json:"f_hide_amount" db:"f_hide_amount"` // 复充
	ShideAmount string `json:"s_hide_amount" db:"s_hide_amount"` // 首充

	Lv1TeamNum     int     `json:"lv1_team_num" db:"lv1_team_num"` // 充值人数
	Lv1Deposit     float64 `json:"lv1_deposit" db:"lv1_deposit"`
	Lv1DepositNum  int     `json:"lv1_deposit_num" db:"lv1_deposit_num"` // 充值人数
	Lv1Withdraw    float64 `json:"lv1_withdraw" db:"lv1_withdraw"`
	Lv1WithdrawNum int     `json:"lv1_withdraw_num" db:"lv1_withdraw_num"` // 提现人数

}
type TblMemberBase struct {
	Uid            string  `json:"uid" db:"uid" cbor:"uid"`
	Pid            string  `json:"pid" db:"pid" cbor:"pid"`
	Username       string  `json:"username" db:"username" cbor:"username"`
	Password       string  `json:"-" db:"password" cbor:"-"`                           //登录密码
	CreatedAt      uint32  `json:"created_at" db:"created_at" cbor:"created_at"`       //注册时间
	CreatedIp      string  `json:"created_ip" db:"created_ip" cbor:"created_ip"`       //注册ip
	Phone          string  `json:"phone" db:"phone" cbor:"phone"`                      //手机
	Email          string  `json:"email" db:"email" cbor:"email"`                      //邮箱
	Tester         int     `json:"tester" db:"tester" cbor:"tester"`                   //1正式2模拟
	Avatar         uint8   `json:"avatar" db:"avatar" cbor:"avatar"`                   //头像id
	InviteCode     string  `json:"invite_code" db:"invite_code" cbor:"invite_code"`    //邀请码
	PayPassword    string  `json:"pay_password" db:"pay_password" cbor:"pay_password"` //支付密码
	State          int     `json:"state" db:"state" cbor:"state"`                      //1正常 2登陆锁定
	Remake         string  `json:"remake" db:"remake" cbor:"remake"`                   //备注
	Prefix         string  `json:"prefix" db:"prefix" cbor:"prefix"`                   //前缀
	OperatorId     string  `json:"operator_id" db:"operator_id" cbor:"operator_id"`    //渠道id
	BusinessId     string  `json:"business_id" db:"business_id" cbor:"business_id"`    //业务员id
	DepositAmount  float64 `json:"deposit_amount" db:"deposit_amount"`
	LastLoginAt    uint32  `json:"last_login_at" db:"last_login_at" cbor:"last_login_at"` //登陆时间
	LastLoginIp    string  `json:"last_login_ip" db:"last_login_ip" cbor:"last_login_ip"` //登陆ip
	Deposit        float64 `json:"deposit" db:"deposit"`
	DepositTimes   int32   `json:"deposit_times" db:"deposit_times"` // 充值人数
	Withdraw       float64 `json:"withdraw" db:"withdraw"`
	WithdrawTimes  int32   `json:"withdraw_times" db:"withdraw_times"` // 提现人数
	Running        float64 `json:"running" db:"running"`
	GameRound      int32   `json:"game_round" db:"game_round"`
	GameWinlost    float64 `json:"game_winlost" db:"game_winlost"`
	GameTax        float64 `json:"game_tax" db:"game_tax"` // 游戏税收
	TurntableBonus float64 `json:"turntable_bonus" db:"turntable_bonus"`
	Brl            float64 `json:"brl" db:"brl"`             // 余额
	IsBloger       int32   `json:"is_bloger" db:"is_bloger"` // 是否博主
	ParentId       string  `json:"parent_id" db:"parent_id" cbor:"parent_id"`
	PswErrCnt      string  `json:"PswErrCnt" db:"PswErrCnt" cbor:"PswErrCnt"`
	BlockTime      string  `json:"BlockTime" db:"BlockTime" cbor:"BlockTime"`
	RealName       string  `json:"real_name" db:"real_name" cbor:"real_name"`
	Currency       string  `json:"currency" db:"currency" cbor:"currency"`
}
type ip_t struct {
	Country string `json:"country" cbor:"country"`
	Region  string `json:"region" cbor:"region"`
	City    string `json:"city" cbor:"city"`
}

type TurntableReviewData struct {
	T int                     `cbor:"t" json:"total"`
	D []TblPddTurntableReview `cbor:"d" json:"d"`
}

type TblPddTurntableInfo struct {
	Uid          string  `json:"uid" db:"uid"`                   // uid
	UnuseChance  int     `json:"unuse_chance" db:"unuse_chance"` // 剩余抽奖次数
	UsedChance   int     `json:"used_chance" db:"used_chance"`   // 已用抽奖次数
	Amount       float64 `json:"amount" db:"amount"`             // 奖励金额
	HandAmount   float64 `json:"hand_amount" db:"hand_amount"`   // 手动奖励金额
	RewardAmount float64 `json:"reward_amount" db:"-"`           // 奖励总金额
	TotAmount    float64 `json:"tot_amount" db:"tot_amount"`     // 已领取的总金额
	Enabled      int     `json:"enabled" db:"enabled"`           // 0停止 1正常
	CreatedAt    int64   `json:"created_at" db:"created_at"`     // 记录时间
	UpdatedAt    int64   `json:"updated_at" db:"updated_at"`     // 更新时间
}

type TurntableHistoryData struct {
	T int                      `cbor:"t" json:"total"`
	D []TblPddTurntableHistory `cbor:"d" json:"d"`
}

type TblPddTurntableHistory struct {
	Id           string  `json:"id" db:"id"`
	Uid          string  `json:"uid" db:"uid"`                     // 用户ID
	Amount       float64 `json:"amount" db:"amount"`               // 奖励金额
	BeforeAmount float64 `json:"before_amount" db:"before_amount"` // 账变前的金额
	AfterAmount  float64 `json:"after_amount" db:"after_amount"`   // 账变后的金额
	CreatedAt    int64   `json:"created_at" db:"created_at"`
	Type         int     `json:"type" db:"type"` // 增加类型 1 大随机金额 2 小随机金额 3 1000元 4 50元 5 1元 6 获得随机次数 7 直接领奖 8 无奖励 9 后台增加
	Remark       string  `json:"remark" db:"remark"`
}

type TblPddTurntableReview struct {
	Id           string  `json:"id" db:"id"`
	Uid          string  `json:"uid" db:"uid"`                     // 申请人uid
	Username     string  `json:"username" db:"username"`           // 申请人
	Amount       float64 `json:"amount" db:"amount"`               // 领取金额
	ReviewRemark string  `json:"review_remark" db:"review_remark"` // 审核备注
	State        int     `json:"state" db:"state"`                 // 状态:1=审核中,2=审核通过,3=审核未通过
	ApplyAt      int64   `json:"apply_at" db:"apply_at"`           // 申请时间
	ReviewAt     int64   `json:"review_at" db:"review_at"`         // 审核时间
	ReviewUid    int     `json:"review_uid" db:"review_uid"`       // 审核人uid
	ReviewName   string  `json:"review_name" db:"review_name"`     // 审核人
}

// 测试号生成
type TblMemberTest struct {
	Id          int     `json:"id,omitempty" db:"id"`
	Uid         int     `json:"uid" db:"uid"` // 申请人uid
	AccountName string  `json:"account_name" db:"account_name"`
	Password    string  `json:"password" db:"password"`
	Amount      float64 `json:"amount" db:"amount"`
	RealName    string  `json:"real_name" db:"real_name"`
	OperatorId  string  `json:"operator_id" db:"operator_id"`
	BusinessId  string  `json:"business_id" db:"business_id"`
	CreateAt    string  `json:"create_at" db:"create_at"`
}

// rpc 更新玩家余额
type UpdateMemberBalanceItem struct {
	SubCmd     int     `json:"SubCmd" db:"SubCmd" cbor:"SubCmd"`
	Uid        int     `json:"uid" db:"uid" cbor:"uid"`
	Balance    float64 `json:"balance" db:"balance" cbor:"balance"`
	HandleType int     `json:"HandleType" db:"HandleType" cbor:"HandleType"` //1 加钱 2 减钱
	ChangeType int     `json:"ChangeType" db:"ChangeType" cbor:"ChangeType"` //变动类型
}
